package com.project.mq.mqclient;

import lombok.Data;

import java.io.IOException;


@Data
public class ConnectionFactory {
    // BrokerServer 的 ip 和 port
    private String host;
    private int port;
    //访问broker serve 的哪个虚拟机
    // 这几个部分暂时不加.
    // private String virtualHost;
    // private String username;
    // private String password;

    // 建立一个 tcp 连接
    public Connection newConnection() throws IOException {
        Connection connection = new Connection(host, port);
        return connection;
    }
}